package org.mlf.fsyq.demo.keystate;

import lombok.SneakyThrows;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Entry {
    @SneakyThrows
    public static void main(String[] args) {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        env.fromElements(
                new Event("a", 1L),
                new Event("b", 2L),
                new Event("c", 3L)
                )
                .keyBy(Event::getKey)
                .flatMap(new Deduplicator())
                .print();

        env.execute();
    }
}
